import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: ()=> import('@/views/Home'),
    children:[
      {
        path: '',
        name: 'homepage',
        component: ()=> import('@/views/HomePage'),
      },
   
      {
        path: '/ding',
        name: 'ding',
        component: ()=> import('@/views/Ding'),
      },
      {
        path: '/shopcar',
        name: 'shopcar',
        component: ()=> import('@/views/ShopCar'),
      },
      {
        path: '/my',
        name: 'my',
        component: ()=> import('@/views/My'),
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: ()=> import('@/views/Login')
  },
  {
    path: '/detail/:id',
    props:true,
    name: 'detail',
    component: ()=> import('@/views/Detail')
  },
  
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
